﻿using System.Collections.Generic;

namespace RG.Common.Const
{
    /// <summary>
    /// Состояния редактируемого объекта
    /// </summary>
    public enum EditableItemStates
    {
        /// <summary>
        /// Не изменен
        /// </summary>
        NotModifed = 0,

        /// <summary>
        /// Изменен
        /// </summary>
        Modifed = 1,

        /// <summary>
        /// Добавлен
        /// </summary>
        Added = 2,

        /// <summary>
        /// Удален
        /// </summary>
        Deleted = 3
    }

    public interface IStatedItem
    {
        EditableItemStates State { get; set; }
    }

    public static class IStatedItem_Ext
    {
        public static void Modify(this IStatedItem i)
        {
            if (i.State == EditableItemStates.NotModifed)
                i.State = EditableItemStates.Modifed;
        }
        public static bool IsModified(this IStatedItem i)
        {
            return (i.State != EditableItemStates.NotModifed);
        }
    }

    public class EditableItemStatesManager
    {
        public static Dictionary<EditableItemStates, string> Names = new Dictionary<EditableItemStates, string>
                                                                         {
                                                                             {EditableItemStates.NotModifed,"Не изменен"},
                                                                             {EditableItemStates.Modifed, "Изменен"},
                                                                             {EditableItemStates.Added, "Добавлен"},
                                                                             {EditableItemStates.Deleted, "Удален"},
                                                                         };
    }

    public enum ReportPaperSize
    {
        A4Portrait, A4Landscape, CustomProtonDp4205
    }

    public abstract class CarAttachType
    {
        public const string ShipmentPhoto = "Машина погружена";
        public const string ForwarderList = "Лист экспедитора";
    }
}
